package cn.hanyx;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.store.FSDirectory;

import java.nio.file.Paths;
import java.util.concurrent.ExecutorService;

/**
 * Created by Administrator on 2017/2/23.
 */
public class SearchUtil {
    public static final Analyzer analyzer = new StandardAnalyzer();

    public static IndexSearcher getIndexSearcher(String indexPath, ExecutorService service, boolean realtime) throws Exception {
        FSDirectory fsDir = FSDirectory.open(Paths.get(indexPath));
        DirectoryReader reader = DirectoryReader.open(IndexUtil.getIndexWriter(indexPath,realtime)) ;
        return null ;
    }

    public static void searchFile() throws Exception {
        long start = System.currentTimeMillis();

    }

    public static void searchContent() throws Exception {

    }
}
